/*
 * Copyright (C) 2010 Graham Allan
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */

package edu.strath.cis.grallan.findbugs.adaptiveranking;

import edu.umd.cs.findbugs.BugInstance;

/**
 * Maps bug instances against a rank.
 * 
 * @author Graham Allan (grallan@cis.strath.ac.uk)
 */
public interface IBugRankMap {

	/**
	 * Returns a rank within the range [0.0d to 1.0d]. It is expected that implementing classes will
	 * rely on an instance of {@link IRankScheme} to provide the value for this, using
	 * {@link IRankScheme#relativePosition(Comparable)}.
	 * 
	 * @see IRankScheme
	 * @param bug
	 * @return double representing the relative position of the rank of this bug
	 */
	double relativeRankFor(BugInstance bug);

	double defaultRelativeRank();

}
